package kr.hkit.myframework.uicomp;

import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class InputPanel extends JPanel {
	private JLabel lbl;
	private JTextField tf;

	/**
	 * Create the panel.
	 */
	public InputPanel() {
		initialize();
	}

	public InputPanel(String str) {
		initialize();
		lbl.setText(str);
	}

	private void initialize() {
		setLayout(new GridLayout(0, 2, 0, 0));

		lbl = new JLabel("New label");
		lbl.setHorizontalAlignment(SwingConstants.CENTER);
		add(lbl);

		tf = new JTextField();
		add(tf);
		tf.setColumns(10);
	}

	public JTextField getTf() {
		return tf;
	}

	public void setTf(String str) {
		tf.setText(str);
	}

	public void setEditable(boolean b){
		tf.setEditable(b);
	}
}
